package cn.xuqiudong.rpc.test.consumer;

import cn.xuqiudong.rpc.common.model.Invoker;
import cn.xuqiudong.rpc.proxy.ProxyFactory;
import cn.xuqiudong.rpc.extension.XqdExtensionFactory;
import cn.xuqiudong.rpc.test.service.DemoService;

import java.io.IOException;

/**
 * 描述:
 * @author Vic.xu
 * @date 2022-02-23 13:27
 */
public class ConsumerMain {

    static ProxyFactory factory = XqdExtensionFactory.defaultExtendFactory().getAdaptiveXqdExtension(ProxyFactory.class);

    public static void main(String[] args) throws IOException {
        Class<DemoService> clazz =DemoService.class;
        Invoker invoker = new Invoker();
        invoker.setInterfaceName(clazz.getName());

        DemoService proxy = factory.getProxy(clazz);
        String result = proxy.say("zhangsan", 20);
        System.out.println(result);
        System.in.read();
    }

}
